package org.yefei.homeworkday23;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class One {

	public static void main(String[] args) {
		// 1:一件商品生产日期是2017/7/12,保质期50天，算出失效日期
		Calendar c = Calendar.getInstance();
		// 生产日期
		SimpleDateFormat s = new SimpleDateFormat("yyyy/MM/dd");
		c.set(2017, 6, 12);
		Date time = c.getTime();
		String format = s.format(time);
		System.out.println("商品的生产日期是" + format);
		c.add(Calendar.DATE, 50);
		Date time2 = c.getTime();
		String format2 = s.format(time2);
		System.out.println("商品的失效日期是：" + format2);
	}
}
